
// header部分
var focus_img = ["./updata/focus1.jpg","./updata/focus2.jpg","./updata/focus3.jpg","./updata/focus4.jpg","./updata/focus5.jpg","./updata/focus6.jpg","./updata/focus7.jpg"];
var header_focus = document.querySelector(".header_focus");
var hot_nav_a_spans = document.querySelectorAll(".hot_nav ul li a > span");
var last_description = hot_nav_a_spans[0].parentElement;
var zhongbangtuijian = document.querySelector(".hot_nav h1:nth-child(2)");
for(let i = 0; i < hot_nav_a_spans.length; i++){
    hot_nav_a_spans[i].parentElement.index = i;
    hot_nav_a_spans[i].onmouseenter = function(){
        last_description.className = "";
        this.parentElement.className = "current";
        header_focus.style.background = `url(${focus_img[i]}) 100%`;
        last_description = this.parentElement;
    }
}
// header自动切换功能
var timer;
hot_nav_a_spans[0].onmouseenter();
timer = setInterval(function(){
    if(last_description.index == 6){
        hot_nav_a_spans[0].onmouseenter();
    }else {
        hot_nav_a_spans[last_description.index+1].onmouseenter();
        console.log(last_description.index);
    }
},1500);


// mod_row_box3
var mod_row_box3_head_navs = document.querySelectorAll(".mod_row_box3 .mod_row_box_head a");
var last_mod_row_box3_head_nav = mod_row_box3_head_navs[0];
for(let i = 0; i <mod_row_box3_head_navs.length; i++){
    mod_row_box3_head_navs[i].onmouseenter = function(){
        last_mod_row_box3_head_nav.className = "mod_users";
        this.className = "mod_users active";
        last_mod_row_box3_head_nav = this;
    }
}

var videos_arr = ["https://ggkkmuup9wuugp6ep8d.exp.bcevod.com/mda-kgkvwy37a7f1ncya/mda-kgkvwy37a7f1ncya.mp4",
"https://gss3.baidu.com/6LZ0ej3k1Qd3ote6lo7D0j9wehsv/tieba-smallvideo/60_9c8f5496cdd76b6bb8758264346196cb.mp4",
"https://gss3.baidu.com/6LZ0ej3k1Qd3ote6lo7D0j9wehsv/tieba-smallvideo/60_910f91012193d06c71c3b04535f227d8.mp4",
"https://gss3.baidu.com/6LZ0ej3k1Qd3ote6lo7D0j9wehsv/tieba-smallvideo/60_c179d4cdc330e4af7c110a1679c7db47.mp4",
"https://gss3.baidu.com/6LZ0ej3k1Qd3ote6lo7D0j9wehsv/tieba-smallvideo/60_494580f6cd6315b52af29bd8bd2b0055.mp4"]


var video = document.querySelector(".mod_row_box3 video");
var mod_row_box3_right_as = document.querySelectorAll(".mod_row_box3 .right a");
for(let i = 0; i < mod_row_box3_right_as.length;i++){
    mod_row_box3_right_as[i].onclick = function(){
        video.setAttribute("autoplay","autoplay");
        video.src = videos_arr[i];
    }
}


window.onscroll = function(){
    console.log(document.documentElement.clientHeight);
    console.log("==========")
    console.log(document.body.scrollTop);
}